﻿<%@ Page Language="C#" MasterPageFile="~/SiteAdmin/MasterTheme/Auto.master" AutoEventWireup="true"
    CodeFile="DataItems.aspx.cs" Inherits="DataItems" %>

<%@ Register Src="UserControls/ImgSelector.ascx" TagName="ImgSelector" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table border="1" cellpadding="1" cellspacing="1">
        <tr>
            <td  valign="top" style="background-color:#96bff4;width:230px;">
                网站模块分类
                <asp:ImageButton ID="ImageButton1" runat="server" AlternateText="刷新" OnClick="ImageButton1_Click" ImageUrl="~/App_Themes/EsSimp/Images/shuaxin.gif" />
                <asp:TreeView ID="TreeView1" runat="server" EnableClientScript="False" ShowLines="True"
                    SkipLinkText="" OnSelectedNodeChanged="TreeView1_SelectedNodeChanged">
                    <SelectedNodeStyle BackColor="PowderBlue" />
                    <NodeStyle Width="100%" />
                </asp:TreeView>
            </td>
            <td valign="top">
                <asp:Label ID="Label3" runat="server" Font-Size="Larger"></asp:Label>
                <br />
                <asp:Label ID="Label1" runat="server">选定要操作的行的“存”列，或“删”列，才会将结果提交到服务器。未选中的不会操作。空白行使用后，在提交后会自动产生。</asp:Label>
                    <asp:GridView ID="GridView1" DataKeyNames="ID" runat="server" AutoGenerateColumns="False"
                        AllowPaging="True" OnPageIndexChanging="GridView1_PageIndexChanging" PageSize="16">
                        <Columns>
                            <asp:TemplateField HeaderText="操作">
                                <ItemTemplate><nobr>
                                    <asp:HyperLink ID="HyperLink3" Target="_blank" Font-Bold="true" runat="server" Text="编辑" NavigateUrl='<%# string.Format("DataItemEditor.Aspx?Lite=Yes&amp;ID={0}", Eval("ID")) %>' ></asp:HyperLink> &nbsp;
                                    <asp:HyperLink Visible="<%#IsManaLinkVisible %>" ID="HyperLink2" Target="_blank" Font-Bold="true" runat="server" Text="管理" NavigateUrl='<%# string.Format("DataItems.Aspx?Lite=Yes&amp;ID={0}", Eval("ID")) %>' ></asp:HyperLink>
                                    </nobr>
                                </ItemTemplate>
                            </asp:TemplateField>

                            <%--<asp:HyperLinkField HeaderText="操作" DataNavigateUrlFields="ID" DataNavigateUrlFormatString="DataItemEditor.Aspx?Lite=Yes&amp;ID={0}"
                                Target="_blank" Text="编辑">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </asp:HyperLinkField>
                            <asp:HyperLinkField HeaderText="" DataNavigateUrlFields="ID" DataNavigateUrlFormatString="DataItemEditor.Aspx?Lite=Yes&amp;ID={0}"
                                Target="_blank" Text="管理">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" />
                            </asp:HyperLinkField>  --%>                          
                            <asp:TemplateField HeaderText="编码">
                                <ItemTemplate>
                                    <asp:Label ID="RID" Font-Bold="true" runat="server" Text='<%# Eval("ID") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="存" ShowHeader="False">
                                <ItemTemplate>
                                    <%--<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete"
                                    Text="删除"></asp:LinkButton>--%>
                                    <asp:CheckBox runat="server" Checked="false" ID="Save" Text="" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="删" ShowHeader="False">
                                <ItemTemplate>
                                    <%--<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete"
                                    Text="删除"></asp:LinkButton>--%>
                                    <asp:CheckBox runat="server" Visible='<%# !String.IsNullOrEmpty(Eval("ID").ToString()) %>'
                                        Checked="false" ID="Del" Text="" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="标题">
                                <ItemTemplate>
                                    <asp:TextBox ID="Title" Width="400" runat="server" Text='<%# Eval("Title") %>'></asp:TextBox>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="图片" Visible="false">
                                <ItemTemplate>
                                    <uc1:ImgSelector ID="Img" runat="server" LinkText="预览 " SelText="选择" Value='<%# Eval("Img") %>' />
                                </ItemTemplate>
                                <ItemStyle Wrap="False" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="排序">
                                <ItemTemplate>
                                    <asp:TextBox ID="SortIdx" Width="32" runat="server" Text='<%# Eval("SortIdx") %>'></asp:TextBox>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="发稿人">
                                <ItemTemplate>
                                    <asp:TextBox ID="Editor" Width="64" runat="server" Text='<%# Eval("Editor") %>'></asp:TextBox>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="发布时间">
                                <ItemTemplate>
                                    <asp:TextBox ID="ContentTime" runat="server" Text='<%# Eval("ContentTime") %>'></asp:TextBox>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="审核">
                                <ItemTemplate>
                                    <asp:CheckBox ID="IsAudit" runat="server" Checked='<%# Bind("IsAudit") %>' Enabled='<%#CanAudit %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="推荐">
                                <ItemTemplate>
                                    <asp:CheckBox ID="IsRecommend" runat="server" Checked='<%# Bind("Recommend") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    <asp:HyperLink ID="HyperLink1" runat="server" Target="_blank" NavigateUrl='<%# "DataItemEditor.Aspx?Lite=Yes&ID=&Gid="+SelID %>'
                        ImageUrl="~/App_Themes/EsSimp/Images/tianjia.gif" Text="添加"></asp:HyperLink>
                    <%--<asp:ImageButton ID="AddButton" runat="server" OnClientClick="return false;" AlternateText="添加" OnClick="AddButton_Click" />--%>
                    <asp:ImageButton ID="SaveButton" runat="server" AlternateText="提交" OnClick="SaveButton_Click" ImageUrl="~/App_Themes/EsSimp/Images/tijiao.gif" />
                    <asp:ImageButton ID="ResetButton" runat="server" AlternateText="刷新" OnClick="ResetButton_Click" ImageUrl="~/App_Themes/EsSimp/Images/shuaxin.gif" /></td>
        </tr>
    </table>
</asp:Content>
